<template>
  <div>
    <el-dialog
      title="个人信息"
      :visible.sync="dialogVisible"
      :close-on-click-modal="false"
      :lock-scroll="false"
      width="1000px"
    >
      <div style="min-height: 200px">
        <Add
          v-if="dialogVisible"
          :userId="userId"
          page="homePage"
          :pageFlag="true"
        />
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="handleEdit">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  components: {
    Add: () => import('../person/user/components/Add.vue'),
  },
  data() {
    return {
      dialogVisible: false,
      userId: this.$store.getters.userId,
    }
  },
  mounted() {
    this.$bus.$on('showUserSetting', (flag) => {
      this.dialogVisible = flag
    })
  },
  beforeDestroy() {
    this.$bus.$off('showUserSetting')
  },
  methods: {
    handleEdit() {
      this.$bus.$emit('submitUpdateUserInfo')
    },
  },
}
</script>
<style scoped lang="scss">
</style>